fix(harness): preserve selected coding agent for template launches - #809
Conversation
Review — PR #809 (round 1)1. Auto-selected agent is still dropped outside the composer (correctness)
Failure: fresh install, only Codex installed, composer shows Codex. Open templates from The test matrix shows the gap: 2. Back/forward navigation discards the composer override (correctness)
Nits
VerdictApproach is right (derive |
0d01cac to
bba398d
Compare
|
wouldn't it be better to have a global state that tracks the harness that you chose instead of passing it to the template creation ? so that we don't have same issue going forward and have only 1 source of truth ? |
Review — PR #809 (round 2)Delta reviewed: Both round-1 findings are fixed: the registry correction now lives in 1. NEW — a failed registry fetch turns template launches into a no-op
2. Round-1 nit 2 — still two sources of truth inside one component
Nothing else new; no confidentiality or published-surface problems in the delta (prose Verdict: finding 1 is worth a one-line guard before merge; the rest of the push |
|
Updated in f608e54: On the earlier dependency-array nit, the flagged array already belonged to Rebased on 6ab81d9. Node 20 CI fails on the archive regression; the same failure reproduces on exact main. The full browser CI run caught a test that changed local storage after App initialized. Updated it in 876d252 to choose Codex through the UI, keeping the project-plus assertion intact. The prior run passed the other 621 tests; CI is rerunning. |
bba398d to
f608e54
Compare
ratataque
left a comment
There was a problem hiding this comment.
just a quick comment above, but otherwise it is much more cleaner now, thank you !
647c389 to
ab0d99f
Compare
|
The coding agents is good. but the backfill stops after 200 conversations, but cleanup still runs afterward. If more than 200 need archiving, cleanup can delete the remaining conversations' raw events before they're archived, e.g. when they're older than 30 days. We should finish archiving the remaining batches before cleanup, and keep the source if archiving fails. |
d5169fc to
9dface7
Compare
9dface7 to
1f3869a
Compare
|
@ratataque thanks again, kept the 200-record limit to control startup writes. Cleanup now waits until archiving is complete. If a pass reaches the limit or fails, we keep the source events and continue on the next scheduled pass. added tests for 200+ conversations, failures, and archive eviction between passes as well |
Problem and motivation
Choosing Codex in Studio could still launch a template with Claude Code. Old conversations could also be lost when archive backfill stopped at 200 records or failed before cleanup.
Summary and scope
Use one App-level harness selection for the composer and template launches. Preferences initialize and persist it; navigation uses the current choice. Registry failures retain the selection, and unavailable defaults are corrected. Archive at most 200 conversations per pass. Keep source events while work remains or archiving fails. Continue at the next six-hour maintenance pass. Track completed writes across passes so archive size cleanup cannot restart the same work.
Bug and fix
flowchart LR A["Select Codex<br/>Use a template"] -->|Before| B["Template launch<br/>defaults to Claude"] B --> C["Claude Code starts"] A -->|After| D["Read App's<br/>selectedHarness"] D --> E["Codex starts"] F["Archive up to 200 conversations"] -->|Complete| G["Run event retention"] F -->|More work or error| H["Keep source events<br/>Continue on the next six-hour pass"] classDef bug fill:#fff1f2,stroke:#be123c,color:#881337 classDef fix fill:#ecfdf5,stroke:#047857,color:#064e3b class B,C bug class D,E fixRelated work
SAP-3121. Codex MCP configuration is separate in #810.
Validation
ff414ffb). Workspace build, typecheck, and lint passed.September 4 native demo of both fixes (before this rebase):
agent-studio-codex-fix-demo.mp4
Checklist and release details
Primary change type
Tests and documentation
Added template tests and archive history, failure, and retry tests. Updated the Harness README.
Compatibility and release impact
@sapiom/harnesspatch notes for selection and archive retention.Security
AI assistance
Codex implemented the change; validation is recorded above.
Checklist
CONTRIBUTING.mdand followed the contribution policy.